package com.ruoyi.backend.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.backend.mapper.SysDictDataMapper;
import com.ruoyi.backend.domain.SysDictData;
import com.ruoyi.backend.service.ISysDictDataService;

/**
 * 服务类别Service业务层处理
 * 
 * @author 王冰冰
 * @date 2025-03-18
 */
@Service
public class SysDictDataServiceImpl implements ISysDictDataService 
{
    @Autowired
    private SysDictDataMapper sysDictDataMapper;

    /**
     * 查询服务类别
     * 
     * @param dictCode 服务类别主键
     * @return 服务类别
     */
    @Override
    public SysDictData selectSysDictDataByDictCode(Long dictCode)
    {
        return sysDictDataMapper.selectSysDictDataByDictCode(dictCode);
    }

    /**
     * 查询服务类别列表
     * 
     * @param sysDictData 服务类别
     * @return 服务类别
     */
    @Override
    public List<SysDictData> selectSysDictDataList(SysDictData sysDictData)
    {
        return sysDictDataMapper.selectSysDictDataList(sysDictData);
    }

    /**
     * 新增服务类别
     * 
     * @param sysDictData 服务类别
     * @return 结果
     */
    @Override
    public int insertSysDictData(SysDictData sysDictData)
    {
        sysDictData.setCreateTime(DateUtils.getNowDate());
        return sysDictDataMapper.insertSysDictData(sysDictData);
    }

    /**
     * 修改服务类别
     * 
     * @param sysDictData 服务类别
     * @return 结果
     */
    @Override
    public int updateSysDictData(SysDictData sysDictData)
    {
        sysDictData.setUpdateTime(DateUtils.getNowDate());
        return sysDictDataMapper.updateSysDictData(sysDictData);
    }

    /**
     * 批量删除服务类别
     * 
     * @param dictCodes 需要删除的服务类别主键
     * @return 结果
     */
    @Override
    public int deleteSysDictDataByDictCodes(Long[] dictCodes)
    {
        return sysDictDataMapper.deleteSysDictDataByDictCodes(dictCodes);
    }

    /**
     * 删除服务类别信息
     * 
     * @param dictCode 服务类别主键
     * @return 结果
     */
    @Override
    public int deleteSysDictDataByDictCode(Long dictCode)
    {
        return sysDictDataMapper.deleteSysDictDataByDictCode(dictCode);
    }
}
